<?php
namespace Business;
class AdvertisingModel {
    static function lists($type,$per_page = 10) {
        $res = new \AdvertisingModel();
        $res = $res
            ->where('status',1);
        if ($type) {
            $res = $res->where('type',$type);
        }
        $res = $res->paginate($per_page);
        if($res){
            $page = $res->toArray();
            $data['data']= $page['data'];
            unset($page['data']);
            $data['page']= $page;
        } else {
            $data = array();
        }
        return $data;

    }
}

